package com.ruoyi.project.rest.trade.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.rest.trade.mapper.RestMemberTradeMapper;
import com.ruoyi.project.rest.trade.domain.RestMemberTrade;
import com.ruoyi.project.rest.trade.service.IRestMemberTradeService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 交易纪录Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-03-28
 */
@Service
public class RestMemberTradeServiceImpl implements IRestMemberTradeService 
{
    @Autowired
    private RestMemberTradeMapper restMemberTradeMapper;

    /**
     * 查询交易纪录
     * 
     * @param id 交易纪录主键
     * @return 交易纪录
     */
    @Override
    public RestMemberTrade selectRestMemberTradeById(Long id)
    {
        return restMemberTradeMapper.selectRestMemberTradeById(id);
    }

    /**
     * 查询交易纪录列表
     * 
     * @param restMemberTrade 交易纪录
     * @return 交易纪录
     */
    @Override
    public List<RestMemberTrade> selectRestMemberTradeList(RestMemberTrade restMemberTrade)
    {
        return restMemberTradeMapper.selectRestMemberTradeList(restMemberTrade);
    }

    /**
     * 新增交易纪录
     * 
     * @param restMemberTrade 交易纪录
     * @return 结果
     */
    @Override
    public int insertRestMemberTrade(RestMemberTrade restMemberTrade)
    {
        restMemberTrade.setCreateTime(DateUtils.getNowDate());
        return restMemberTradeMapper.insertRestMemberTrade(restMemberTrade);
    }

    /**
     * 修改交易纪录
     * 
     * @param restMemberTrade 交易纪录
     * @return 结果
     */
    @Override
    public int updateRestMemberTrade(RestMemberTrade restMemberTrade)
    {
        return restMemberTradeMapper.updateRestMemberTrade(restMemberTrade);
    }

    /**
     * 批量删除交易纪录
     * 
     * @param ids 需要删除的交易纪录主键
     * @return 结果
     */
    @Override
    public int deleteRestMemberTradeByIds(String ids)
    {
        return restMemberTradeMapper.deleteRestMemberTradeByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除交易纪录信息
     * 
     * @param id 交易纪录主键
     * @return 结果
     */
    @Override
    public int deleteRestMemberTradeById(Long id)
    {
        return restMemberTradeMapper.deleteRestMemberTradeById(id);
    }
}
